//
//  CatogryStrategyViewController.m
//  project
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CatogryStrategyViewController.h"
#import "StrategyCollectionViewCell.h"

@interface CatogryStrategyViewController () <UICollectionViewDataSource,UICollectionViewDelegate>

//创建表头

//创建collectionView
@property(nonatomic,strong)UICollectionView *strategyCollectionView;

@end

@implementation CatogryStrategyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
    layout.itemSize = CGSizeMake((kWidth - 80) / 4, (kWidth - 80) / 4);
    layout.sectionInset = UIEdgeInsetsMake(0, 20, 0, 20);
    layout.minimumInteritemSpacing = 10;
    layout.minimumLineSpacing = 10;
    layout.headerReferenceSize = CGSizeMake(kWidth, 150);
    
    _strategyCollectionView = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 70, kWidth, kHeight - 70) collectionViewLayout:layout];
    _strategyCollectionView.delegate = self;
    _strategyCollectionView.dataSource = self;
    _strategyCollectionView.backgroundColor = [UIColor whiteColor];
    [_strategyCollectionView registerClass:[StrategyCollectionViewCell class] forCellWithReuseIdentifier:@"StrategyCollectionViewCell"];
    [self.view addSubview:_strategyCollectionView];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return 4;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    StrategyCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"" forIndexPath:indexPath];
    cell.backgroundColor = [UIColor grayColor];
    return cell;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
